package com.jinmdz.fmis.core.constant;

/**
 * 业务组编码枚举
 *
 * @author LiCongLu
 * @date 2020-02-12 10:51
 */
public enum EBusinessType {
    EMPTY("", "空"),
    /**
     * 接运任务用物品服务
     */
    USE_IN_TRANSPORT_TASK("use_in_transport_task", "接运任务用物品服务"),

    /**
     * 冷藏业务用物品服务
     */
    USE_IN_COLD_STORAGE("use_in_cold_storage", "冷藏业务用物品服务"),

    /**
     * 礼厅业务用物品服务
     */
    USE_IN_MOURN_CEREMONY("use_in_mourn_ceremony", "礼厅业务用物品服务"),

    /**
     * 整容服务
     */
    TYPE_OF_FACE_LIFT("type_of_face_lift", "整容服务"),

    /**
     * 火化用物品服务
     */
    USE_IN_CREMATION("use_in_cremation", "火化用物品服务"),
    /**
     * 车辆调度接运信息物品服务
     */
    USE_IN_REC_INFO("use_in_rec_info", "车辆调度接运信息物品服务"),

    /**
     * 丧葬用品
     */
    TYPE_OF_FUNERAL_SUPPLIES("type_of_funeral_supplies", "丧葬用品"),

    /**
     * 纸棺
     */
    TYPE_OF_COFFIN("type_of_coffin", "纸棺"),

    /**
     * 插花
     */
    TYPE_OF_ARRANGE_FLOWER("type_of_arrange_flower", "插花"),

    /**
     * 冷藏出入藏费用
     */
    COLD_STORAGE_IN_OUT("cold_storage_in_out", "冷藏出入藏费用");

    /**
     * 枚举值
     */
    private String type;
    /**
     * 枚举信息
     */
    private String message;

    private EBusinessType(String type, String message) {
        this.type = type;
        this.message = message;
    }

    public String getType() {
        return type;
    }

    public EBusinessType setType(String type) {
        this.type = type;
        return this;
    }

    public String getMessage() {
        return message;
    }

    public EBusinessType setMessage(String message) {
        this.message = message;
        return this;
    }


    /**
     * 获取枚举类
     *
     * @param type 枚举值
     * @return
     * @author LiCongLu
     * @date 2020-02-12 10:52
     */
    public static EBusinessType getEBusinessType(String type) {
        if (type != null) {
            for (EBusinessType typeEnum : EBusinessType.values()) {
                if (typeEnum.getType() != null) {
                    if (typeEnum.getType().equals(type)) {
                        return typeEnum;
                    }
                }
            }
        }
        return EBusinessType.EMPTY;
    }

    /**
     * 判断枚举与type值是否相等
     *
     * @param type 枚举值
     * @return
     * @author LiCongLu
     * @date 2020-02-12 10:52
     */
    public boolean equalEnum(String type) {
        return this.getType().equals(type);
    }
}
